package com.gxy.learn.design.principle.interface_segregation_principle;

import lombok.extern.slf4j.Slf4j;

/**
 * @description: 接口隔离原则：客户端不应该被迫依赖它不适用的方法，一个类对另一个类的依赖应该建立在最小的接口上
 * @author: gaoxueyong
 * @Date: 2022/11/6 14:36
 */
@Slf4j
public class InterfaceSegregationPrincipleClient {
    public static void main(String[] args) {
//        防盗门
        ASafeDoor aSafeDoor = new ASafeDoor();
        log.info("aSafeDoor具有功能：{},{}");
        aSafeDoor.antiTheft();
        aSafeDoor.fireProof();

        BSafeDoor bSafeDoor = new BSafeDoor();
        log.info("bSafeDoor具有功能：{},{}");
        bSafeDoor.antiTheft();
        bSafeDoor.waterProof();

        CSafeDoor cSafeDoor = new CSafeDoor();
        log.info("cSafeDoor具有功能：{},{}");
        cSafeDoor.antiTheft();
        cSafeDoor.fireProof();
        cSafeDoor.waterProof();
    }
}
